package com.hsh.tools;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class HolidayUtil {
    public static void getInstanceWeek() {
        Calendar c = Calendar.getInstance();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date da = new Date();
        String format = dateFormat.format(da);
        System.out.println(format);

////        Date date = DateUtils.addDaysWithTruncate(new Date(), 7);
////        String s = DateUtils.formatDate(date, DateUtils.DATE_FORMAT_YYYY_MM_DD);
////        System.out.println(s);

        c.setTime(da);
        int week = c.get(Calendar.DAY_OF_WEEK) - 1;
        String[] weeks = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
        String xQ = weeks[week];
        System.out.println(xQ);
    }

    public static void main(String[] args) {
        getInstanceWeek();
//        System.out.println(s);
    }

}
